package com.edu.his.controller;

import com.edu.his.domain.CheckRequest;
import com.edu.his.domain.MedicalRecord;
import com.edu.his.service.CheckRequestService;
import com.edu.his.util.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 描述：
 * 创建人：飘
 * 创建时间：2024/12/20
 **/
@RestController
@RequestMapping("/checkrequest")
@CrossOrigin(value = "*",maxAge = 3600)
public class CheckRequestController {
    @Autowired
    private CheckRequestService checkRequestService;

    @PostMapping("/insert")
    public R insert(@RequestBody  CheckRequest checkRequest)
    {
        return  this.checkRequestService.insert(checkRequest);
    }

    @GetMapping("/updatestate/{ids}/{state}")
    public R updateState(@PathVariable("ids") Integer[] ids,@PathVariable("state") int state) {
        return  this.checkRequestService.updateState(ids,state);
    }

    /**
     * 检查修改-检查
     * @param checkRequest
     * @return
     */
    @PutMapping("/updatecheck")
    public R updateCheck(@RequestBody  CheckRequest checkRequest)
    {
        return  this.checkRequestService.updateCheck(checkRequest);
    }

    /**
     * 检查修改--录入结果
     * @param checkRequest
     * @return
     */
    @PutMapping("/updateinpucheck")
   public R updateInpuCheck(@RequestBody CheckRequest checkRequest)
    {
        return  this.checkRequestService.updateInpuCheck(checkRequest);
    }

    @GetMapping("/selectbyregisgerandmedicaltonologid/{registerId}/{medicalTechnologyId}")
    public R selectByRegisgerAndMedicalTonologId(@PathVariable("registerId") Integer registerId, @PathVariable("medicalTechnologyId")Integer medicalTechnologyId) {
    return  this.checkRequestService.selectByRegisgerAndMedicalTonologId(registerId,medicalTechnologyId);
    }



}
